#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2018-03-27 20:54:55
import sys


data = sys.stdin.readline()
begin, end = data.split(' ')
# print(begin, end)
sum_nums = 0

'''
def checkNum(n):
    tmp = 0
    for i in n:
        tmp += int(i)
    if tmp % 3 == 0:
        return 1
    else:
        return 0
'''


tmpstring = 0
for i in range(1, int(end) + 1):
    tmpstring += i
    if i < int(begin):
        continue
    else:
        '''
        # ret = checkNum(tmpstring)
        if ret == 1:
            sum_nums += 1
        '''
        if tmpstring % 3 == 0:
            sum_nums += 1

print sum_nums
